<template>
    <div id="app">
        <h1>按钮</h1>
        <button v-on:click="method0">归零</button>
        <br>
        <button v-on:click="method1">+1</button>
        <button v-on:click="method2">+2</button>
        <br>
        <button v-on:click="method3">-1</button>
        <button v-on:click="method4">-2</button>
        <h3>{{count}}</h3>
    </div>
</template>

<script>
export default {
    name: 'App',
    data() {
        return {
            count: 0,
        }
    },
    methods: {
        method0(){
            this.count=0
        },
        method1(){
            this.count++;
        },
        method2(){
            this.count+=2;
        },
         method3(){
            this.count--;
        },
         method4(){
            this.count-=2;
        }
    }
}
</script>
